
//
//  BaseButton.m
//  LingQianZhu
//
//  Created by 谢英泽 on 2016/12/14.
//  Copyright © 2016年 谢英泽. All rights reserved.
//

#import "BaseButton.h"

@implementation BaseButton

- (instancetype)init
{
    self = [super init];
    if (self) {
    }
    return self;
}

- (void)setAvailable:(BOOL)available
{
    _available = available;
    if (available) {
        self.alpha = 1.f;
        self.userInteractionEnabled = YES;
    }else{
        self.alpha = 0.5f;
        self.userInteractionEnabled = NO;
    }
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    [self setTitle:title forState:UIControlStateNormal];
}

- (void)setImageName:(NSString *)imageName
{
    _imageName = imageName;
    [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
}

- (void)setSelectImageName:(NSString *)selectImageName
{
    _selectImageName = selectImageName;
    [self setImage:[UIImage imageNamed:selectImageName] forState:UIControlStateSelected];
}

- (void)setTitleColor:(UIColor *)titleColor
{
    _titleColor = titleColor;
    [self setTitleColor:titleColor forState:UIControlStateNormal];
}

- (void)setBackNormalImage:(UIImage *)backNormalImage
{
    _backNormalImage = backNormalImage;
    [self setBackgroundImage:backNormalImage forState:UIControlStateNormal];
}

- (void)setBacHighlightedImage:(UIImage *)bacHighlightedImage
{
    _bacHighlightedImage = bacHighlightedImage;
    [self setBackgroundImage:bacHighlightedImage forState:UIControlStateHighlighted];
}
@end
